package net.whatmark.playavillain.meshikau.page;

import javax.servlet.http.HttpServletRequest;

import org.t2framework.t2.annotation.composite.POST;
import org.t2framework.t2.annotation.core.ActionParam;
import org.t2framework.t2.annotation.core.Default;
import org.t2framework.t2.annotation.core.Page;
import org.t2framework.t2.annotation.core.RequestParam;
import org.t2framework.t2.contexts.WebContext;
import org.t2framework.t2.navigation.Forward;
import org.t2framework.t2.navigation.Redirect;
import org.t2framework.t2.spi.Navigation;

@Page("requestparam")
public class RequestParamPage {

	@Default
	public Navigation index(WebContext context) {
		return Redirect.to("/pages/requestParam.jsp");
	}

	@POST
	@ActionParam
	public Navigation message(@RequestParam("left") String left,
			@RequestParam("right") String right, HttpServletRequest request) {
		request.setAttribute("message", left + " : " + right);
		return Forward.to("/pages/requestParam.jsp");
	}

}
